1. /* getlong.cpp by K.Tsuru */
  2. /****************
  3. long type
  4. *****************/
  5. #include "getnum.h"
  6. #include <string>
  7. using namespace std;
  8. static const char* skipch = ",. ";
  9. static bool skip(char c) {
  10. return strchr(skipch, c) != NULL;
  11. }
  12. long GetLong(){
  13. string buff;
  14. char c;
  15. while(1) {
  16. if((c = getchar())== '\n') break;
  17. if(skip(c)) continue;
  18. buff.append(1, c);
  19. }
  20. return atol(buff.c_str());
  21. }

getlong.cpp : last modifiled at 2017/02/26 15:55:36(428 bytes)
created at 2016/04/11 11:17:20
The creation time of this html file is 2017/10/07 10:54:15 (Sat Oct 07 10:54:15 2017).